<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>User Information</title>
	<link rel="stylesheet" type="text/css"
		href="../themes/#{themeBean.theme}/skin.css" />
</h:head>
<h:body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="title">User Information</ui:define>
		<ui:define name="manuBar">
			<h:form>
				<p:menubar autoSubmenuDisplay="true" id="menu"
					style="font-size:small">
					<p:menuitem value="Home" url="/controlling/index.xhtml"
						icon="ui-icon-document" immediate="true"
						onstart="waiteDialog.show();" />
					<p:menuitem value="change Password" icon="ui-icon-document"
						immediate="true" onstart="changePassDlg.show();" />
				</p:menubar>
			</h:form>
		</ui:define>
		<ui:define name="content">
			<h:form id="frm_createUser">
				<f:metadata>
					<f:event type="postAddToView"
						listener="#{userBean.loadLoggedUserInformation}" />
				</f:metadata>
				<p:panel id="userInfoPan" header="User Information"
					style="font-size: 12px;">
					<h:panelGrid columns="2">
						<h:outputText value="User Name" />
						<h:outputText value="#{userBean.user.userName}" style="color:red" />

						<h:outputText value="Firest Nmae" />
						<h:outputText value="#{userBean.user.firstName}" style="color:red" />

						<h:outputText value="Second Name" />
						<h:outputText value="#{userBean.user.secondName}"
							style="color:red" />

						<h:outputText value="Mobile" />
						<h:outputText value="#{userBean.user.mobile}" style="color:red" />

						<h:outputText value="Email" />
						<h:outputText value="#{userBean.user.email}" style="color:red" />

						<h:outputText value="Group Name" />
						<p:selectOneMenu value="#{userBean.user.groupId}"
							style="font:small;" required="true" disabled="true"
							requiredMessage="Group Name is Required">
							<f:selectItem itemValue="" itemLabel="-----Select Group-----" />
							<f:selectItems value="#{userBean.groupsList}" var="group"
								itemLabel="#{group.name}" itemValue="#{group.recid}" />
						</p:selectOneMenu>

					</h:panelGrid>

					<p:messages id="msg" showSummary="true" />

				</p:panel>
			</h:form>

			<p:dialog id="changePass" widgetVar="changePassDlg" modal="true"
				closable="true" header="Change My Password" resizable="false">
				<h:form>
					<h:panelGrid columns="2" id="matchGrid">
						<h:outputLabel id="dd" for="opwd" value="Old Password: *" />
						<p:password id="opwd" value="#{changePasswordBean.oldPassword}"
							feedback="true" required="true"
							requiredMessage="Old Password is required" />
						<h:outputLabel for="pwd1" value="New Password: *" />
						<p:password id="pwd1" value="#{changePasswordBean.password1}"
							match="pwd2" feedback="true" label="Password 1" required="true"
							requiredMessage="New Password is required"
							validatorMessage="The two passwords should be same" />
						<h:outputLabel for="pwd2" value="ReType Password: *" />
						<p:password id="pwd2" value="#{changePasswordBean.password2}"
							label="ReType Password" required="true" feedback="true"
							requiredMessage="ReType Password is required" />

					</h:panelGrid>
					<p:commandButton id="saveButton" value="Save" icon="ui-icon-disk"
						actionListener="#{changePasswordBean.changePassword}"
						update="messages" style="height: 30px;font-size: small"/>
					<p:commandButton id="close" value="Close" icon="ui-icon-closethick" immediate="true"
						onstart="changePassDlg.hide();" style="height: 30px;font-size: small"/>
					<p:messages id="messages" autoUpdate="true" />
				</h:form>
			</p:dialog>
		</ui:define>
	</ui:composition>
</h:body>
</html>

